import axios from './axios'
import {eduUrl} from '@/config/config'


// 获取栏目id
export const getColumnApi = () => {
  return new Promise((resolve,reject) => {
      axios({
          url: eduUrl + '/api/cms/columns?projectId=3',
          method: 'get'
      }).then(res => {
          resolve(res)
      })
  });
}

// 根据栏目id  获取列表
export const getColumnListApi = (params) => {
  return new Promise((resolve,reject) => {
      axios({
          url: eduUrl + '/api/cms/columns/'+ params.id +'/items',
          method: 'get',
          params: params.data
      }).then(res => {
          resolve(res.data)
      })
  });
}

// 根据文章id  获取文章详情
export const getDetailsApi = (params) => {
  return new Promise((resolve,reject) => {
      axios({
          url: eduUrl + '/api/cms/items/' + params,
          method: 'get'
      }).then(res => {
          resolve(res.data)
      })
  });
}
